//
//  SPStorePlanModen.swift
//  StorePlan
//
//  Created by admin on 2020/9/4.
//  Copyright © 2020 admin. All rights reserved.
//

import Foundation
import RealmSwift
import Combine
class SPStorePlanModen: ObservableObject {
//
    let didChange = PassthroughSubject<SPStorePlanModen, Never>()
    
    @Published var plans: [StoreDataItem] = []
  
    
    let realm = try! Realm()
    var notificationToken: NotificationToken? = nil
    var pid: String = ""
    init() {
    }
    
    public func update(pid: String) {
        self.pid = pid
        self.plans = Array(realm.objects(StoreDataItem.self).filter("parment=='\(pid)'").freeze())
        
    }
  

}
